<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>proxy</title>
</head>
<body>
    <script>
        let obj = {
            name:'张三',
            age:19
        }
        let newTarget = new Proxy(obj,{
            set(tartget,prop,newValue,receiver){
                Reflect.set(tartget,prop,newValue,receiver)
                console.log(tartget,prop,newValue,receiver)
            },
            get(tartget,prop,receiver){
                console.log(tartget,prop,receiver)
            }
        })
        newTarget.name = '李四'
        newTarget.name
    </script>
</body>
</html>